﻿<local:DocumentBase x:Class="WPFExcelReport.YCAFS05ADD"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:mx="clr-namespace:DynamicListView.Controls;assembly=MatrixLib"
                    xmlns:wep="clr-namespace:WPFExcelReport"
                    Height="700" Width="1024" 
                    FontSize="16"
                   Background="White"
                    Loaded="Window_Loaded"
     >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:TextTrimmingConverter  x:Key="Trim"/>
        <ucd:QtyColorConverter  x:Key="qtyc"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetMaster" />
        <db:SETINTEXDB  x:Key="SetProd" />
        <CollectionViewSource   x:Key="vwFSSTAMM" Source="{Binding Path=FSSTAMM,Source={StaticResource SetData}}" />
        <CollectionViewSource   x:Key="vwFSFARBEN" Source="{Binding Path=FSFARBEN,Source={StaticResource SetMaster}}" />
        <CollectionViewSource   x:Key="vwFSGROE" Source="{Binding Path=FSGROE,Source={StaticResource SetMaster}}" />
        <CollectionViewSource   x:Key="vwSFSSTAMM" Source="{Binding Path=FSSTAMM,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwSFSFARBEN" Source="{Binding Path=FSFARBEN,Source={StaticResource SetProd}}" />
        <CollectionViewSource   x:Key="vwFSSTUELI" Source="{Binding Path=FSSTUELI_EXT,Source={StaticResource SetProd}}" />        
        <CollectionViewSource   x:Key="vwSFSGROE" Source="{Binding Path=FSGROE,Source={StaticResource SetProd}}" /> 
        <CollectionViewSource   x:Key="vwABPOS" Source="{Binding Path=ABPOS,Source={StaticResource SetProd}}" /> 
    </local:DocumentBase.Resources>
    <Grid   >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="300"/>
            <ColumnDefinition Width="400"/>
            <ColumnDefinition Width="400" />
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
            <WrapPanel>
                <StackPanel>
                    <Button FontSize="18" Height="40" Width="40" Margin="5,0,0,0" Name="btnQuerySData" Click="btnQuerySData_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="Image/Find.png" />
                        </Button.Background>
                    </Button>
                </StackPanel>
                <StackPanel>
                    <TextBlock FontSize="18"   Width="Auto"  Margin="0,0,0,0" Text="原料" />
                    <ComboBox
                    Name="cbWTYE"
                    HorizontalAlignment="Left"
                    IsEditable="True"
                    Background="White"
                        Text="高级辅料"
                    IsTextSearchEnabled="True"
                    IsTextSearchCaseSensitive="False"                           
                    Width="Auto" 
                    >
                        <ComboBoxItem Content="成衣款式"/>
                        <ComboBoxItem Content="面料"/>
                        <ComboBoxItem Content="辅料"/>
                        <ComboBoxItem Content="高级辅料"/>
                    </ComboBox>
                </StackPanel>
                <StackPanel>
                    <WrapPanel>
                        <TextBox Background="Yellow"  FontSize="18"    Width="180" Name="txtMAT" CharacterCasing="Upper"  Text="" />
                    </WrapPanel>
                </StackPanel>
                <StackPanel>
                    <Button Name="btnAppend" Click="btnAppend_Click" Margin="30,0,0,0" Height="40" Width="40">
                        <Button.Background>
                            <ImageBrush  ImageSource="Image/Add.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Margin="30,0,0,0" >插入BOM</TextBlock>
                </StackPanel>
                <StackPanel>
                    <Button FontSize="18" Height="40" Width="40" Margin="20,0,0,0" Name="btnRefreshAB" Click="btnRefreshAB_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="Image/Reload.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Margin="20,0,0,0" >刷新生产单</TextBlock>
                </StackPanel>
                <StackPanel>
                    <Button FontSize="18" Height="40" Width="40" Margin="20,0,0,0" Name="btnUpdateIntex" Click="btnUpdateIntex_Click">
                        <Button.Background>
                            <ImageBrush  ImageSource="Image/Save.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock Margin="20,0,0,0" >保存</TextBlock>
                </StackPanel>
            </WrapPanel>
        </StackPanel>
        <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="1"> 
                <StackPanel Orientation="Horizontal" >
                    <TextBlock Text="款式:" />
                    <TextBox Name="txtFSART" MinWidth="180"  Height="40" VerticalAlignment="Top">2</TextBox>
                    <Button x:Name="btnRefresh" Click="btnRefresh_Click" Width="40" Height="40">
                        <Button.Background>
                            <ImageBrush  ImageSource="Image/Reload.png" />
                        </Button.Background>
                    </Button>
                </StackPanel>
          
            <DataGrid  
                ItemsSource="{Binding Source={StaticResource ResourceKey=vwFSSTAMM}}"  
                AutoGenerateColumns="False"
                EnableRowVirtualization="False"
                VerticalScrollBarVisibility="Auto"
                HorizontalScrollBarVisibility="Auto"
                VerticalAlignment="Stretch"
                HeadersVisibility="Column" 
                MaxHeight="600"
                FontSize="14"
                IsReadOnly="True"
                HorizontalAlignment="Stretch"
                RowDetailsVisibilityMode="Visible">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=FSART, Converter={StaticResource ResourceKey=Trim}}" Header="款式" Width="Auto" MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=FSABEZ, Converter={StaticResource ResourceKey=Trim}}" Header="描述" Width="Auto" MinWidth="120" />
                </DataGrid.Columns>
            </DataGrid>
        </StackPanel>
        <DockPanel Grid.Row="1"  Grid.RowSpan="2"  Grid.Column="1" Grid.ColumnSpan="2">
            <Grid   >
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="200" />
                </Grid.RowDefinitions> 
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <WrapPanel Grid.Row="0"  Grid.Column="0" >
         
                </WrapPanel>
                <WrapPanel></WrapPanel>
                <StackPanel Grid.Row="1" Grid.Column="0" >
                    <WrapPanel>
                        <TextBlock>款式</TextBlock>
                        <TextBlock Background="Yellow" Width="120" Text="{Binding FSART, Source={StaticResource ResourceKey=vwFSSTAMM}}"></TextBlock>
                    </WrapPanel>
                    <WrapPanel>
                        <TextBlock>色号</TextBlock>
                        <ComboBox
                            Name="cbFFARBE"
                            HorizontalAlignment="Left"
                            IsEditable="True"
                            Background="White"
                            IsTextSearchEnabled="True"
                            IsTextSearchCaseSensitive="False"                           
                            Width="Auto" 
                            MinWidth="100"
                            DisplayMemberPath="FSFFARBE"
                            SelectedValuePath="FSFFARBE"
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwFSFARBEN}}"  
                    >

                        </ComboBox>
                    </WrapPanel>
                    <WrapPanel>
                        <TextBlock>尺码</TextBlock>
                        <ComboBox
                            Name="cbFSIZE"
                            HorizontalAlignment="Left"
                            IsEditable="True"
                            Background="White"
                            IsTextSearchEnabled="True"
                            IsTextSearchCaseSensitive="False"                           
                            Width="Auto" 
                            MinWidth="100"
                            DisplayMemberPath="FSGGROE"
                            SelectedValuePath="FSGGROE"
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwFSGROE}}"  
                    >
                        </ComboBox>
                    </WrapPanel>
                </StackPanel>
                <StackPanel  Grid.Row="2" Grid.Column="0" >
                    <WrapPanel>
                        <TextBlock>原料</TextBlock>
                        <TextBlock Background="Yellow" Width="120" Text="{Binding FSART, Source={StaticResource ResourceKey=vwSFSSTAMM}}"></TextBlock>
                    </WrapPanel>
                    <WrapPanel>
                        <TextBlock>色号</TextBlock>
                        <ComboBox Background="Yellow"
                                    Name="cbSFFARBE"
                                    HorizontalAlignment="Left"
                                    IsEditable="True" 
                                    IsTextSearchEnabled="True"
                                    IsTextSearchCaseSensitive="False"                           
                                    Width="Auto" 
                                    MinWidth="100"
                                    DisplayMemberPath="FSFFARBE"
                                    SelectedValuePath="FSFFARBE"
                                    ItemsSource="{Binding Source={StaticResource ResourceKey=vwSFSFARBEN}}"  
                                    >
                        </ComboBox>
                    </WrapPanel>
                    <WrapPanel>
                        <TextBlock>尺码</TextBlock>
                        <ComboBox
                            Name="cbSFSIZE"
                            HorizontalAlignment="Left"
                            IsEditable="True"
                         Background="Yellow"
                            IsTextSearchEnabled="True"
                            IsTextSearchCaseSensitive="False"                           
                            Width="Auto" 
                            MinWidth="100"
                            DisplayMemberPath="FSGGROE"
                            SelectedValuePath="FSGGROE"
                          ItemsSource="{Binding Source={StaticResource ResourceKey=vwSFSGROE}}"  
                    >
                        </ComboBox>
                    </WrapPanel>
                    <WrapPanel>
                        <TextBlock>用量</TextBlock>
                        <TextBox Name="txtSQTY" Text="1" Width="80"></TextBox>
                        <ComboBox
                                    Name="cbSMEEH"
                                    HorizontalAlignment="Left"
                                    IsEditable="True"
                                    Background="White"
                                    Text="PCS"
                                    IsTextSearchEnabled="True"
                                    IsTextSearchCaseSensitive="False"                           
                                    Width="Auto" 
                                    >
                            <ComboBoxItem Content="PCS"/>
                            <ComboBoxItem Content="M"/>
                            <ComboBoxItem Content="MTR"/>
                            <ComboBoxItem Content="KG"/>
                        </ComboBox>
                        <TextBlock>损耗%</TextBlock>
                        <TextBox Name="txtSWASTAGE" Text="3" Width="40"></TextBox>
                    </WrapPanel>
                </StackPanel>
                <DataGrid Grid.Row="0" Grid.Column="1"  Grid.ColumnSpan="1" Grid.RowSpan="3"
                                CanUserReorderColumns="True"  
                                CanUserResizeRows="True" 
                                CanUserSortColumns="True"                  
                                AutoGenerateColumns="False"   
                                EnableRowVirtualization="False"  
                                HorizontalAlignment="Stretch" 
                                VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True"
                                ItemsSource="{Binding Source={StaticResource ResourceKey=vwABPOS}}"  
                                x:Name="SizeColorMatrixDataGrid" 
                                Margin="0,1,0,0" 
                                IsTextSearchCaseSensitive="True"  
                         >                   
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=ABPAUFKRS}" Header=" "   Width="40" />
                        <DataGridTextColumn Binding="{Binding Path=ABPAUFLFD}" Header="生产单"   Width="80" />
                        <DataGridTextColumn Binding="{Binding Path=ABPAUFPOS}" Header=""   Width="40" /> 
                        <DataGridTextColumn Binding="{Binding Path=ABPFARBE}" Header="颜色"   Width="60" />
                        <DataGridTextColumn Binding="{Binding Path=ABPGROE}" Header="尺码"   Width="60" />
                        <DataGridTextColumn Binding="{Binding Path=ABPSOLLMENGE7,Converter={StaticResource ResourceKey=d100}}" Header="数量"   Width="60" />
                    </DataGrid.Columns>
                </DataGrid  >
                <StackPanel Grid.Row="3"  Grid.Column="0" Grid.ColumnSpan="2">
                    <TextBlock Name="txtMessage" Width="300"></TextBlock>
                <DataGrid 
                    CanUserReorderColumns="True"  
                    CanUserResizeRows="True" 
                    CanUserSortColumns="True"                  
                    AutoGenerateColumns="False"   
                    EnableRowVirtualization="False"   
                    VerticalAlignment="Stretch"
                    VerticalScrollBarVisibility="Auto"
                    HorizontalScrollBarVisibility="Auto"
                    IsSynchronizedWithCurrentItem="True"
                    ItemsSource="{Binding Source={StaticResource ResourceKey=vwFSSTUELI}}"  
                    x:Name="dlgFSSTUELI" 
                    Margin="0,1,0,0"  
                    >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=FSSFARBE}" Header="颜色"   Width="60" />
                        <DataGridTextColumn Binding="{Binding Path=FSSGROE}" Header="尺码"   Width="60" />
                        <DataGridTextColumn Binding="{Binding Path=FSSMATKZ}" Header="类"   Width="30" />
                        <DataGridTextColumn Binding="{Binding Path=FSSMART}" Header="原料"   Width="120" />
                        <DataGridTextColumn Binding="{Binding Path=FSSMFARBE}" Header="颜色"   Width="60" />
                        <DataGridTextColumn Binding="{Binding Path=FSSMGROE}" Header="尺寸"   Width="40" />
                        <DataGridTextColumn Binding="{Binding Path=FSSVERBR, Converter={StaticResource ResourceKey=d1000}}" Header="用量"   Width="60" />
                        <DataGridTextColumn Binding="{Binding Path=FSSVBME}" Header="单位"   Width="60" />
                            <DataGridTextColumn Binding="{Binding Path=FSSVERL, Converter={StaticResource ResourceKey=d100}}" Header="损耗"   Width="60" />
                    </DataGrid.Columns>
                </DataGrid  >
                </StackPanel>
            </Grid >
        </DockPanel> 
    </Grid>
</local:DocumentBase>
